<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link href="/lib/layui/css/layui.css" rel="stylesheet"/>
    <link href="/css/common.css" rel="stylesheet"/>
    <title>编辑代码生成</title>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space10">
        <div class="layui-card">
            <div class="layui-card-body">
                <form class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">数据库表名：</label>
                        <div class="layui-input-block">
                            <input class="layui-input" type="text" name="tableName" lay-verify="required" placeholder="请输入数据库表名" autocomplete="off" readonly>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="layui-color-red">*</span>&nbsp;功能描述：</label>
                        <div class="layui-input-block">
                            <input class="layui-input" type="text" name="description" lay-verify="required" placeholder="请输入功能描述" autocomplete="off"
                                   maxlength="1000">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="layui-color-red">*</span>&nbsp;包名称：</label>
                        <div class="layui-input-block">
                            <input class="layui-input" type="text" name="packageName" lay-verify="required" placeholder="请输入包名称" autocomplete="off"
                                   maxlength="1000">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="layui-color-red">*</span>&nbsp;模块名称：</label>
                        <div class="layui-input-block">
                            <input class="layui-input" type="text" name="moduleName" lay-verify="required" placeholder="请输入模块名称" autocomplete="off"
                                   maxlength="1000">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="layui-color-red">*</span>&nbsp;功能名称：</label>
                        <div class="layui-input-block">
                            <input class="layui-input" type="text" name="functionName" lay-verify="required" placeholder="请输入功能名称" autocomplete="off"
                                   maxlength="1000">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="layui-color-red">*</span>&nbsp;实体类：</label>
                        <div class="layui-input-block">
                            <input class="layui-input" type="text" name="entityName" lay-verify="required" placeholder="请输入实体类" autocomplete="off"
                                   maxlength="1000">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="layui-color-red">*</span>&nbsp;代码作者：</label>
                        <div class="layui-input-block">
                            <input class="layui-input" type="text" name="authorName" lay-verify="required" placeholder="请输入代码作者" autocomplete="off"
                                   maxlength="1000" value="rong yuan">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="layui-color-red">*</span>&nbsp;模板类型：</label>
                        <div class="layui-input-block">
                            <select name="templateType" lay-verify="required">
                                <option value="base">基础模板</option>
                                <option value="extend" selected>扩展模板</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <input type="hidden" name="id">
                            <button class="layui-btn" lay-filter="submitBtn" lay-submit data-url="/system/generator/saveOrUpdate.do">提交</button>
                            <button class="layui-btn layui-hide" type="button" id="submit">提交</button>
                            <button class="layui-btn layui-btn-primary" type="button" id="cancel">取消</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script src="/lib/layui/layui.all.js" charset="utf-8"></script>
<script src="/script/common.js" charset="utf-8"></script>
<script>
    var id = getRequestParams('id');

    layui.use(['baseUtil'], function () {
        var $ = layui.jquery,
            baseUtil = layui.baseUtil;

        $('input[name=id]').val(id);

        var url = '/system/generator/findOne.do';
        var params = { id: id };
        var cols = [
            { type: 'input', name: 'tableName' },
            { type: 'input', name: 'description' },
            { type: 'input', name: 'packageName' },
            { type: 'input', name: 'moduleName' },
            { type: 'input', name: 'functionName' },
            { type: 'input', name: 'entityName' },
            { type: 'input', name: 'authorName' }
        ];
        baseUtil.initFormData(url, params, cols);
    });
</script>
</body>
</html>
